#!/usr/bin/perl

$name = "$ARGV[0]";   # pass argument from php to perl code
$value = "";   # initializing value

open $file, "<", "OrganizationInfo.txt";

while ($line = <$file>) {   # checks all lines in file

        if($line =~ 
	/^\s*$name\s*=\s*
	(([+|-]?\d+(\.\d)?)|
	\"(.+)\"|
	\'(.+)\')
	\s*(\#.*)?$/x) 
	{
		if($2 != null) { $value = $2; }
		if(!($4 =~ /^$/)) { $value = $4; }
		if(!($5 =~ /^$/)) { $value = $5; }
        }
}

$value =~ s/\<br\/\>/\n/g;   # replaces all <br/> with \n

print $value."\n";

close $file;

exit(5);
